home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / PROGRAMM / DB_CLIPP / 0411.ZIP / TESTDATA.C < prev    next >
Text File  |  1985-09-19  |  564b  |  35 lines

  1. /*
  2.  * Program to write a series of blocks of data with hex codes from 0 to ff.
  3.  */
  4. #include "stdio.h"
  5. main(argc,argv)
  6.     int argc;
  7.     char *argv[];
  8.     {
  9.     int c,
  10.     i,
  11.     outfile;
  12.     if (argc < 2)
  13.     {
  14.     puts("Missing output Filename\n");
  15.     exit(1);
  16.     }
  17.     if ((outfile = open(argv[1],1)) == -1)
  18.     {
  19.     if ((outfile = creat(argv[1])) == -1)
  20.         {
  21.         printf("\nCannot open ");
  22.         puts(argv[1]);
  23.         exit(1);
  24.         }
  25.     }
  26.     for(i=0;i<6;i++)
  27.     {
  28.     for(c=0;c<256;c++)
  29.         {
  30.         fputc(c,outfile);
  31.         }
  32.     }
  33.     fclose(outfile);
  34.     }
  35.